<template>
	<view class="budgetSheet">
		<hx-navbar ref="hxnb" :config="config" />
		<view class="budget">
			<view class="flex"
				style="padding-bottom: 40rpx;line-height: 54rpx;margin: 24rpx 0;border-bottom: 1rpx solid rgba(30,30,30,0.1);">
				<text style="font-size: 32rpx;">项目名称</text>
				<text style="margin-left: 60rpx;">{{quotationData.name}}</text>
			</view>
			<view class="flex"
				style="padding-bottom: 40rpx;line-height: 54rpx;margin: 24rpx 0;border-bottom: 1rpx solid rgba(30,30,30,0.1);">
				<text style="font-size: 32rpx;">预约时间</text>
				<text style="margin-left: 60rpx;">{{quotationData.time}}</text>
			</view>
			<view class="flex"
				style="padding-bottom: 40rpx;line-height: 54rpx;margin: 24rpx 0;border-bottom: 1rpx solid rgba(30,30,30,0.1);">
				<text style="font-size: 32rpx;">项目编号</text>
				<text style="margin-left: 60rpx;">{{quotationData.inventory}}</text>
			</view>
			<view class="flex" style="line-height: 54rpx;">
				<text style="font-size: 32rpx;">安装费用(元)</text>
			 <input type="number" placeholder="请输入你的估计费用" style="margin-left:40rpx;" v-model="value"> 
			</view>
			
		</view>
		<view class="pay">
			<view class="pay_money" @click="quotationDetail()">
				确定项目
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 协议同意
				isAgree: false,
				// 安装师傅
				isInstallation: false,
				config: {
					title: "项目详情"
				},
				quotationData:{},
				value:'',
				time:''

			}
		},
		onLoad(e) {
			this.quotationData = JSON.parse(e.data)
			this.quotationData = JSON.parse(this.quotationData)
			this.time = this.quotationData.time 
			this.quotationData.time = this.$tools.fileTime(this.quotationData.time)
			console.log(this.quotationData,'秘密')
			},
		methods: {
			quotationDetail(e){
				if(this.value == '') return this.$tools.showToast('请填写安装费用')
				let data = {
					orderNum :this.quotationData.orderNum,
					appointTime:this.time,
				    installAmount:this.value
				}
				this.$api.inviteInstall(data).then((res) => {
					if(res.data.result.code ==0){
						this.$tools.showToast('项目确认成功')
						setTimeout(()=>{
							uni.navigateBack()
						},1000)
					}else{
						this.$tools.showToast(res.data.result.message)
					}
					console.log(res,'瓦打我打我的')
				})
			},
		}
	}
</script>

<style scoped>
	.verify {
		width: 304rpx;
		height: 86rpx;
		background: #492D22;
		border-radius: 8rpx;
		font-size: 36rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 86rpx;
		text-align: center;
		margin: 30rpx auto 0;
	}

	.prompt {
		background: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		margin: 30rpx;
		height: 588rpx;
	}

	.quxiao {
		width: 68rpx;
		height: 68rpx;
		background-size: 100% 100%;
		background-image: url('/clientEnd/static/7730.png');
	}

	.pay_money {
		background: #492D22;
		border-radius: 8rpx;
		font-size: 36rpx;
		font-family: Noto Sans SC-Regular, Noto Sans SC;
		font-weight: 400;
		color: #FFFFFF;
		margin: 30rpx auto;
		text-align: center;
		width: 554rpx;
		height: 86rpx;
		line-height: 86rpx;
	}

	.pay {
		background: #fff;
		position: fixed;
		bottom: 0;
		padding: 20rpx 30rpx;
		width: 100%;
	}

	.payType {
		justify-content: space-between;
		background-color: #fff;
		border-radius: 20rpx;
		margin: 30rpx;
		width: 690rpx;
		padding: 30rpx;
	}

	.budget {
		width: 690rpx;
		border-radius: 20rpx;
		margin: 30rpx;
		padding: 40rpx 30rpx;
		background-color: #fff;
		background-size: 100% 100%;
		background-image: url('/clientEnd/static/baomi.png');
	}
</style>
